package com.hzit.pay.center.factory;

import com.hzit.pay.center.service.strategy.IPaymentService;
import com.hzit.pay.center.service.strategy.impl.AlipayPagePayServiceImpl;

import java.util.concurrent.ConcurrentHashMap;

/**
 * 支付工厂：母的根据支付方式去生成不同对象
 */
public class PayStrategyFactory {


    public static ConcurrentHashMap<String,IPaymentService> concurrentHashMap = new ConcurrentHashMap<String,IPaymentService>();

    /**
     * 根据支付方式获取支付策略对象
     * @param payMethod
     * @return
     */
    public static IPaymentService getPayStrategy(String payMethod){

        IPaymentService paymentService = concurrentHashMap.get(payMethod);

        return paymentService;

    }
}
